package com.whq.security.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RequestMapping("/user")
@RestController
public class UserController {
    public static Logger logger = LoggerFactory.getLogger(UserController.class);

    @GetMapping("/hello")
    public String hello(@RequestParam(name = "name") String username,HttpServletRequest request) {
        return username;
    }

    @GetMapping("/login")
    public String login() {
        logger.info("login");
        return "login success";
    }
}
